package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HmzBorrowMasterMapper;
import com.ruoyi.system.domain.HmzBorrowMaster;
import com.ruoyi.system.service.IHmzBorrowMasterService;

/**
 * 领用单主Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-31
 */
@Service
public class HmzBorrowMasterServiceImpl implements IHmzBorrowMasterService 
{
    @Autowired
    private HmzBorrowMasterMapper hmzBorrowMasterMapper;

    /**
     * 查询领用单主
     * 
     * @param id 领用单主主键
     * @return 领用单主
     */
    @Override
    public HmzBorrowMaster selectHmzBorrowMasterById(Long id)
    {
        return hmzBorrowMasterMapper.selectHmzBorrowMasterById(id);
    }

    /**
     * 查询领用单主列表
     * 
     * @param hmzBorrowMaster 领用单主
     * @return 领用单主
     */
    @Override
    public List<HmzBorrowMaster> selectHmzBorrowMasterList(HmzBorrowMaster hmzBorrowMaster)
    {
        return hmzBorrowMasterMapper.selectHmzBorrowMasterList(hmzBorrowMaster);
    }

    /**
     * 新增领用单主
     * 
     * @param hmzBorrowMaster 领用单主
     * @return 结果
     */
    @Override
    public int insertHmzBorrowMaster(HmzBorrowMaster hmzBorrowMaster)
    {
        hmzBorrowMaster.setCreateTime(DateUtils.getNowDate());
        return hmzBorrowMasterMapper.insertHmzBorrowMaster(hmzBorrowMaster);
    }

    /**
     * 修改领用单主
     * 
     * @param hmzBorrowMaster 领用单主
     * @return 结果
     */
    @Override
    public int updateHmzBorrowMaster(HmzBorrowMaster hmzBorrowMaster)
    {
        hmzBorrowMaster.setUpdateTime(DateUtils.getNowDate());
        return hmzBorrowMasterMapper.updateHmzBorrowMaster(hmzBorrowMaster);
    }

    /**
     * 批量删除领用单主
     * 
     * @param ids 需要删除的领用单主主键
     * @return 结果
     */
    @Override
    public int deleteHmzBorrowMasterByIds(Long[] ids)
    {
        return hmzBorrowMasterMapper.deleteHmzBorrowMasterByIds(ids);
    }

    /**
     * 删除领用单主信息
     * 
     * @param id 领用单主主键
     * @return 结果
     */
    @Override
    public int deleteHmzBorrowMasterById(Long id)
    {
        return hmzBorrowMasterMapper.deleteHmzBorrowMasterById(id);
    }
}
